package com.pk.android.view.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

import com.pk.android.R;
import com.pk.android.model.NavDrawer;

public class NavDrawerAdapter extends ArrayAdapter<NavDrawer>{
	//private final Context context;
	private LayoutInflater layoutInflate;

	public enum LayoutSectionType{
		LIST_ITEM, 
		HEADER_ITEM
	}
	
  public NavDrawerAdapter(Context context, NavDrawer[] values) {
    super(context, R.layout.expandlist_team, values);
    
    layoutInflate = LayoutInflater.from(context);
  }
  
  @Override
  public int getViewTypeCount() {
      return LayoutSectionType.values().length;
  }

  @Override
  public int getItemViewType(int position) {
      return getItem(position).getViewType();
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    
	  NavDrawer navitem = this.getItem(position);
	  View view = navitem.getView(layoutInflate, convertView);
      
	  return view;
    
	  //NavDrawer navDrawer = values.get(position);
  }

@Override
public boolean isEnabled(int position) {
	// TODO Auto-generated method stub
	NavDrawer navitem = this.getItem(position);
	return navitem.isEnabled(position);
}

  
  
}
